// i.d(t, { P: () => Attachment })
import ObservableObject from "../observer/observable.object"
import attachmentEnum from "../enum/attachment.enum"
import extEnum from "../enum/ext.enum"

export default class Attachment extends ObservableObject {
  category: string
  mediaType: string
  mimeType: string
  src: string
  height: number
  width: number
  url: string
  thumbnailUrl: string
  created: any
  assetId: string
  assetType: string
  filename: string
  bytes: any
  id: string
  constructor(e) {
    super()
    this.category = attachmentEnum.EXTERNAL
    this.mediaType = extEnum.IMAGE
    this.mimeType = ""
    this.src = ""
    this.height = 0
    this.width = 0
    e && Object.assign(this, e)
  }
  copy(e: Attachment) {
    this.id = e.id
    this.src = e.src
    this.url = e.url
    this.thumbnailUrl = e.thumbnailUrl
    this.height = e.height
    this.width = e.width
    this.created = e.created
    this.category = e.category
    this.mediaType = e.mediaType
    this.assetId = e.assetId || ""
    this.assetType = e.assetType
    this.filename = e.filename
    this.bytes = e.bytes
    this.mimeType = e.mimeType || ""
    return this
  }
}
